package com.hddf.project.dao;

import java.util.List;

import org.hibernate.Session;

import com.hddf.project.pojos.Project;
import com.hddf.project.pojos.ProjectApproval;
import com.hddf.project.pojos.ProjectCheck;
import com.hddf.project.pojos.ProjectDoc;
import com.hddf.project.pojos.ProjectImg;
import com.hddf.project.pojos.ProjectOther;
import com.hddf.project.pojos.ProjectTable;
import com.hddf.project.pojos.ProjectVideo;

public interface ProjectDao {

	/**
	 * 根据三级ID获取项目
	 * 
	 * @param id
	 * @param s
	 * @return
	 */
	public List<Project> getProjectsByThirdCategory(Integer t_id, Integer startData, Integer lengthData, Session s)
			throws Exception;

	/**
	 * 根据三级ID获取项目数量
	 * 
	 * @param id
	 * @param s
	 * @return
	 */
	public Integer getProjectsCountByThirdCategory(Integer t_id, Session s) throws Exception;

	/**
	 * 查询全部项目的数量
	 * 
	 * @param s
	 * @return
	 */
	public Integer getAllProject(Session s) throws Exception;

	/**
	 * 根据一级分类ID获取项目
	 * 
	 * @param f_id
	 * @param s
	 * @return
	 * @throws Exception
	 */
	public List<Project> getProjectsByFirstCategory(Integer f_id, Integer startData, Integer lengthData, Session s)
			throws Exception;

	/**
	 * 根据二级分类ID获取项目
	 * 
	 * @param f_id
	 * @param s
	 * @return
	 * @throws Exception
	 */
	public List<Project> getProjectsBySecondCategory(Integer s_id, Integer startData, Integer lengthData, Session s)
			throws Exception;

	/**
	 * 根据一级ID获取项目数量
	 * 
	 * @param id
	 * @param s
	 * @return
	 */
	public Integer getProjectsCountByFirstCategory(Integer f_id, Session s) throws Exception;

	/**
	 * 根据二级ID获取项目数量
	 * 
	 * @param id
	 * @param s
	 * @return
	 */
	public Integer getProjectsCountBySecondCategory(Integer s_id, String plan, Session s) throws Exception;

	/**
	 * 根据二级ID获取项目数量
	 * 
	 * @param id
	 * @param s
	 * @return
	 */
	public Integer getProjectsCountByMoreConditions(Integer f_id, Integer s_id, Integer t_id, String projectName,
			String startTime, String endTime, String startFund, String endFund, String mgrDepart,
			String buildSide, String plan, List<String> area, Short ispass, Short comment, Short checkout,
			Session s) throws Exception;

	/**
	 * 根据二级分类ID获取项目
	 * 
	 * @param f_id
	 * @param s
	 * @return
	 * @throws Exception
	 */
	public List<Project> getAllProjects(Integer startData, Integer lengthData, Session s) throws Exception;

	/**
	 * 根据ID获取项目
	 * 
	 * @param p_id
	 * @param s
	 * @return
	 * @throws Exception
	 */
	public List<ProjectDoc> getDocsByProjectId(Integer p_id, Session s) throws Exception;

	/**
	 * 根据ID获取项目
	 * 
	 * @param p_id
	 * @param s
	 * @return
	 * @throws Exception
	 */
	public List<ProjectImg> getImgsByProjectId(Integer p_id, Session s) throws Exception;

	/**
	 * 根据ID获取项目
	 * 
	 * @param p_id
	 * @param s
	 * @return
	 * @throws Exception
	 */
	public List<ProjectTable> getTablesByProjectId(Integer p_id, Session s) throws Exception;

	/**
	 * 根据ID获取项目
	 * 
	 * @param p_id
	 * @param s
	 * @return
	 * @throws Exception
	 */
	public List<ProjectApproval> getApprovalsByProjectId(Integer p_id, Session s) throws Exception;

	/**
	 * 根据项目ID获取部门意见
	 * 
	 * @param p_id
	 * @param s
	 * @return
	 * @throws Exception
	 */
	public List<ProjectCheck> getChecksByProjectId(Integer p_id, Session s) throws Exception;

	/**
	 * 根据项目ID获取
	 * 
	 * @param p_id
	 * @param s
	 * @return
	 * @throws Exception
	 */
	public List<ProjectVideo> getVideoByProjectId(Integer p_id, Session s) throws Exception;

	/**
	 * 根据很多的查询条件查询符合结果的项目
	 * 
	 * @return
	 */
	public List<Project> getProjectListByMoreConditions(Integer startData, Integer lengthData, Integer f_id,
			Integer s_id, Integer t_id, String projectName, String startTime, String endTime, String startFund,
			String endFund, String mgrDepart, String buildSide, String plan, List<String> area, Short ispass,
			Short comment, Short checkout, Session s) throws Exception;

	/**
	 * 根据一级分类ID获取对应的项目数量
	 * 
	 * @param f_id
	 * @return
	 * @throws Exception
	 */
	public Integer getProjectCountByCategoryFirst(Integer f_id, Session s) throws Exception;

	/**
	 * 根据名字和项目ID查询批件
	 * 
	 * @param uploadName
	 * @param s
	 * @return
	 * @throws Exception
	 */
	public ProjectApproval getApprovalByUploadName(Integer projectId, String uploadName, Session s)
			throws Exception;

	/**
	 * 根据名字和项目ID查询意见
	 * 
	 * @param uploadName
	 * @param s
	 * @return
	 * @throws Exception
	 */
	public ProjectCheck getCheckByUploadName(Integer projectId, String uploadName, Session s) throws Exception;

	/**
	 * 根据名字和项目ID查询文档
	 * 
	 * @param uploadName
	 * @param s
	 * @return
	 * @throws Exception
	 */
	public ProjectDoc getDocByUploadName(Integer projectId, String uploadName, Session s) throws Exception;

	/**
	 * 根据名字和项目ID查询图片
	 * 
	 * @param uploadName
	 * @param s
	 * @return
	 * @throws Exception
	 */
	public ProjectImg getImgByUploadName(Integer projectId, String uploadName, Session s) throws Exception;

	/**
	 * 根据名字和项目ID查询三表
	 * 
	 * @param uploadName
	 * @param s
	 * @return
	 * @throws Exception
	 */
	public ProjectTable getTableByUploadName(Integer projectId, String uploadName, Session s) throws Exception;

	/**
	 * 根据名字和项目ID查询三表
	 * 
	 * @param uploadName
	 * @param s
	 * @return
	 * @throws Exception
	 */
	public ProjectVideo getVideoByUploadName(Integer projectId, String uploadName, Session s) throws Exception;

	/**
	 * 根据名字和项目ID查询其他文件
	 * 
	 * @param uploadName
	 * @param s
	 * @return
	 * @throws Exception
	 */
	public ProjectOther getOtherByUploadName(Integer projectId, String uploadName, Session s);

	// /**
	// * 查询是否有新更新的批示
	// *
	// * @param s
	// * @return
	// * @throws Exception
	// */
	// public List<CheckAnnotations> getUpdateNotation(Session s) throws
	// Exception;
	//
	// /**
	// * 根据项目ID查询是否存在更新
	// * @param projectId
	// * @param s
	// * @return
	// * @throws Exception
	// */
	// public CheckAnnotations getCheckAnnotationsByProjectId(Integer projectId,
	// Session s) throws Exception;

	/**
	 * 根据计划查询项目，并按照一级、二级、三级类别正序排序
	 * 
	 * @param planId
	 * @param s
	 * @return
	 * @throws Exception
	 */
	public List<Project> projectByPlanId(List<Integer> planIds, Session s) throws Exception;

	/**
	 * 根据项目名称查找项目实体
	 * 
	 * @param name
	 * @return
	 */
	public Project project(String name, Session s);

	/**
	 * 获取项目类别为空的数据
	 * 
	 * @return
	 */
	public List<Project> listProjectCategory(Session s);

	/**
	 * 根据ID获取项目
	 * 
	 * @param p_id
	 * @param s
	 * @return
	 * @throws Exception
	 */
	public List<ProjectOther> getOtherByProjectId(Integer p_id, Session s);
}